package com.zyw.security.shiro.stateless.realm;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * @author zhangyw
 * @date 2017/12/6 14:33
 */
public class StatelessToken implements AuthenticationToken {

    String username; // 登录用户名
    String password; // 登录密码

    String token; // 访问令牌 ，若没有访问令牌，则为获取
    String agent; // 代理

    Integer userid; // 登录用户ID

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getAgent() {
        return agent;
    }

    public void setAgent(String agent) {
        this.agent = agent;
    }

    public Integer getUserid() {
        return userid;
    }

    public void setUserid(Integer userid) {
        this.userid = userid;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public Object getPrincipal() {
        return getUsername();
    }

    @Override
    public Object getCredentials() {
        return getPassword();
    }
}
